package com.sky.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sky.entity.Setmeal;
import com.sky.vo.DishItemVO;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;


/**
 * <p>
 * 套餐 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-05-18
 */
@Mapper
public interface SetmealMapper extends BaseMapper<Setmeal> {
    /**
     * 根据分类id查询套餐的数量
     * @param id
     * @return
     */
    @Select("select count(id) from setmeal where category_id = #{categoryId}")
    Integer countByCategoryId(Long id);

    Page<SetmealVO> list(Page<SetmealVO> p, @Param("ew") QueryWrapper<Setmeal> wrapper);



    List<DishItemVO> getishItemById(Long id);

    Integer countByMap(HashMap map);
}
